#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <QModelIndex>
#include <QCloseEvent>
#include <QStringList>
#include <QList>

#include "connector.h"
#include "database_plugins/idatabase.h"
#include "keypressfilter.h"
#include "mystatusbar.h"

namespace Ui {
    class MainWindow;
}

class MainWindow : public QMainWindow
{
    Q_OBJECT
private:
	Ui::MainWindow *ui;

	class MainWindowPrivate;
	MainWindowPrivate *d;

public:
    explicit MainWindow(QWidget *parent = 0);
    ~MainWindow();


protected:
	void closeEvent(QCloseEvent *);


private slots:
	void threadStarted();

	void showItem(QModelIndex item);
	void showConfigDialog();
	void tryConnect();

	void connectSlot();
	void connectSlotE();
	void disconnectSlot();
	void hostNotFoundSlot();
	void connectionRefusedSlot();
	void sslErrorSlot(QStringList errors);

	void markAs();

signals:
	void itemReaded(const QModelIndex &index);
	void itemUnreaded(const QModelIndex &index);
	void itemDeleted(QList<int>);
	void connectToHostEncrypted(const QString &hostName, quint16 port);
};

#endif // MAINWINDOW_H
